<template>
  <div>
<!--    <Row style="padding:20px">-->
<!--      <Col span="20" offset="3">-->
<!--        <Card shadow>-->
<!--          <p slot="title">token历史</p>-->
<!--          <p>Content of card</p>-->
<!--          <p>Content of card</p>-->
<!--          <p>Content of card</p>-->
<!--        </Card>-->
<!--      </Col>-->
<!--    </Row>-->
<!--    <Row style="padding:20px">-->
<!--      <Col span="20" offset="3">-->
<!--        <Card shadow>-->
<!--          <p slot="title">token发行表</p>-->
<!--          <p>Content of card</p>-->
<!--          <p>Content of card</p>-->
<!--          <p>Content of card</p>-->
<!--        </Card>-->
<!--      </Col>-->
<!--    </Row>-->
    <Row style="padding:20px">
      <Col span="8" offset="3">
        <Card shadow style="width: 320px" >
          <div style="text-align:center" @click="burnToken">
            <img src="../../../../../public/ss.jpg" style="width: 100%" alt="">
            <h3>销毁通证</h3>
          </div>
        </Card>
      </Col>
      <Col span="8" offset="3">
        <Card shadow style="width: 320px" >
          <div style="text-align:center" @click="releaseToken">
            <img src="../../../../../public/ss.jpg" style="width: 100%" alt="">
            <h3>添加通证</h3>
          </div>
        </Card>
      </Col>
    </Row>
    <div v-if="updateModal">
      <create-token ref="createToken" @CloseModal="closeModal" />
    </div>
    <div v-if="burnModal">
      <burn-token ref="burnToken"  @CloseModal="closeBurnModal"/>
    </div>

  </div>
</template>
<script>
import CreateToken from "@/views/League/components/carbonCredits/components/CreateToken";
import BurnToken from "@/views/League/components/carbonCredits/components/BurnToken";
export default {
  components: {BurnToken, CreateToken},
  data(){
    return{
      updateModal:true,
      burnModal:true
    }
  },
  methods:{
    releaseToken(){
      this.$nextTick(()=>{
        this.$refs.createToken.modalVisible = true
      })
    },
    burnToken(){
      this.$refs.burnToken.modalVisible = true
    },
    closeModal(val){
        this.$refs.createToken.modalVisible = val
      setTimeout(()=>{
        this.$nextTick(()=>{
          this.updateModal=false
          this.$nextTick(()=>{
            this.updateModal=true
          })
        })
      },200)
    },
    closeBurnModal(val){
      this.$refs.burnToken.modalVisible = val
      setTimeout(()=>{
        this.$nextTick(()=>{
          this.burnModal=false
          this.$nextTick(()=>{
            this.burnModal=true
          })
        })
      },200)
    }
  }
}
</script>

<style lang="less">

</style>
